import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/user/login',
    name: 'login',
    component: ()=> import('@/views/login/index.vue')
  },
  {
    path: '/user/register',
    name: 'register',
    component: ()=> import('../views/register/index.vue')
  },
  {
    path: '/user/registerTags',
    name: 'registerTags',
    component: ()=> import('../views/register/registerTags.vue')
  },
  {
    path: '/',
    name: 'BasicLayout',
    redirect: '/home',
    component: ()=> import('../layouts/BasicLayout.vue'),
    // redirect: '/home',
    children:[
      {
        path: 'home',
        name: 'homie匹配',
        component: ()=> import('../views/home/index.vue')
      },
      {
        path: 'blog',
        name: '博客',
        component: ()=> import('../views/blog/index.vue')
      },
      {
        path: 'message',
        name: '消息',
        component: ()=> import('../views/message/index.vue')
      },
      {
        path: 'team',
        name: '找队伍',
        component: ()=> import('../views/team/index.vue')
      },
      {
        path: 'self',
        name: '个人中心',
        component: ()=> import('../views/self/index.vue')
      },
    ]
  },
  {
    path: '/team/create',
    name: '创建队伍',
    component: ()=> import('../views/team/createTeam.vue')
  },
  {
    path: '/blog/create',
    name: '创建博客',
    component: ()=> import('../views/blog/blogCreate.vue')
  },
  {
    path: '/blog/:id',
    name: '博客详情',
    component: ()=> import('../views/blog/blogDetail.vue')
  },
  {
    path: '/message/chat',
    name: '公共聊天室',
    component: ()=> import('../views/message/publicChat.vue')
  },


]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
